<?php

class PHPWarning
{
    public static $Deprecated;
    public static $Strict;

    public static function Init()
    {
        self::$Deprecated = new PHPWarning(E_DEPRECATED);
        self::$Strict = new PHPWarning(E_STRICT);
    }

    /** @var int */
    private $phpWarningConst;

    /**
     * @param int $phpWarningConst
     */
    public function __construct($phpWarningConst)
    {
        $this->phpWarningConst = $phpWarningConst;
    }

    /**
     * @return int
     */
    public function GetPhpWarningConst()
    {
        return $this->phpWarningConst;
    }
}
PHPWarning::Init();

class Warning
{
    private static $suppressStack = array();

    public static function BeginSuppress(PHPWarning $warning)
    {
        array_push(self::$suppressStack, error_reporting());
        error_reporting(error_reporting() & ~($warning->GetPhpWarningConst()));
    }

    public static function EndSuppress()
    {
        $reportLevel = array_pop(self::$suppressStack);
        error_reporting($reportLevel);
    }
    
}

?>